//
// Created by sjjmw on 3/24/2022.
//
#include "iostream"
#include "vector"
#include "list"
#include "algorithm"
#include "string"
#include "unordered_map"
#include "cmath"
#include<iomanip>
#include "string"
#include "map"
#include "list"

struct Xpy{
    int has;
    int allneed;
};
bool cmp(Xpy&xpy1,Xpy&xpy2){
    return (xpy1.allneed-xpy1.has)
            <(xpy2.allneed-xpy2.has);
};
struct Sol{
    std::vector<Xpy> vec;
    void handle(
            ){
        int n;std::cin>>n;
        for(int i=0;i<n;i++){
            Xpy xpy{};
            std::cin>>xpy.has>>xpy.allneed;
            vec.push_back(xpy);
        }
        std::sort(vec.begin(),vec.end(),cmp);
        if(vec[0].allneed>vec[0].has){
            printf("NO\n");
            return;
        }
        for(int i=1;i<vec.size();i++){
            vec[i].has+=vec[i-1].has;
            if(vec[i].allneed>vec[i].has){
                printf("NO\n");
                return;
            }
        }
        printf("YES\n");
    }
};
int main(){
//    int a,b,c;
    float a,b,c,d;
    int e;
    while(std::cin>>a){
        for(int i=0;i<a;i++){
            Sol().handle();
        }
    }

    return 0;
}